package defaulPackage;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;

public class Band {
	private String name;
	private Style style;
	private int year;
	private List<Profile> members;
	private List<File> files;
	
	public Band(String name, Style style, int year) {
		this.name = name;
		this.style = style;
		this.year = year;
		members = new LinkedList<Profile>();
		files = new LinkedList<File>();
	}

	
	public void addFile(File file){
		files.add(file);
	}
	
	public void removeFile(File file) {
		for (int x = 0; x < files.size(); x++) {
			if (file.match(files.get(x))) {
				System.out.println("FIle removido com sucesso!");
				files.remove(x);
				break;
			}
		}
	}

	public void removeFriend(Profile profile) {
		for (int x = 0; x < members.size(); x++) {
			if (profile.match(members.get(x))) {
				System.out.println("Amigo removido com sucesso!");
				members.remove(x);
				break;
			}
		}
	}

	public void addMember(Profile profile) {
		members.add(profile);
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Style getStyle() {
		return style;
	}

	public void setStyle(Style style) {
		this.style = style;
	}

	public int getYear() {
		return year;
	}

	public List<Profile> getMembers() {
		return members;
	}
	
	public List<File> search(File file){
		List<File> search = new ArrayList<File>();
		for (File f: files){
			if (file.match(f)){
				search.add(f);
			}
		}
		return search;
	}
	
	public List<File> getMusics(){
		List<File> musics = new LinkedList<File>();
		for(File file: files){
			if (file instanceof Music){
				musics.add(file);
			}
		}
		return musics;
	}
	
	public List<File> getPhotos() {
		List<File> photos = new LinkedList<File>();
		for(File file: files){
			if (file instanceof Photo){
				photos.add(file);
			}
		}
		return photos;
	}
	
	public List<File> getVideos() {
		List<File> videos = new LinkedList<File>();
		for(File file: files){
			if (file instanceof Video){
				videos.add(file);
			}
		}
		return videos;
	}

}
